package test1202;

import com.qf.bean.Grade2;
import com.qf.bean.Menu;
import com.qf.bean.Role;
import com.qf.service.ManyToManyService;
import com.qf.service.Student2Service;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * 2019/12/2
 * Administrator
 * springdata1130
 * 面向对象面向君  不负代码不负卿
 */
public class Demo2 {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("springData.xml");
        ManyToManyService service=(ManyToManyService) applicationContext.getBean("manyservice");

        List<Menu> menus = service.findmenus();
        for (Menu menu : menus) {
            System.out.println(menu.getMenuname());
            List<Role> roleList = menu.getRoleList();
            for (Role role : roleList) {
                System.out.println("\t"+role.getRname());
            }
        }
    }
}
